package com.lagou.client;

import com.lagou.service.UserService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.PostConstruct;

@RestController
public class HelloController {
    private UserService userService;
    @PostConstruct
    private void init(){
        userService = (UserService) RpcConsumer.createProxy(UserService.class);
    }
    @RequestMapping("/hello")
    public String hello(String name){
        return userService.sayHello(name);
    }

}
